package com.ubs.persistence.entity;

import java.io.Serializable;
import javax.persistence.*;

import java.util.Set;


/**
 * The persistent class for the service database table.
 * 
 */
@Entity
@Table(name="service")
@NamedQueries({
	@NamedQuery(name="ServiceEntity.selectPrimaryServices", 
				query="SELECT s FROM ServiceEntity s " +
					  "WHERE s.parentServiceId is null " +
					  "AND s.visible = :visible")
})

public class ServiceEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="id")
	private int id;
	
	@SuppressWarnings("unused")
	@Column(name="parent_service_id", nullable=true)
	private Long parentServiceId;

	@Column(name="activation_price")
	private float activationPrice;

	@Column(name="price_per_month")
	private float pricePerMonth;

	@Column(name="cation")
	private String cation;

	@Column(name="service_included")
	private String serviceIncluded;

    @Lob()
	@Column(name="wiki_description")
	private String wikiDescription;
    
    @Column
    private String visible;

    @Column
    private String optional;
    
    @Column(name="test_service", nullable=false, length=1)
    private String testService;

    //bi-directional many-to-one association to Service
    @ManyToOne
	@JoinColumn(name="id", referencedColumnName="parent_service_id", insertable=false, updatable=false)
	private ServiceEntity parentService;

	//bi-directional many-to-one association to Service
	@OneToMany(mappedBy="parentService")
	private Set<ServiceEntity> subServices;

    public ServiceEntity() {
    }

	public float getActivationPrice() {
		return this.activationPrice;
	}

	public void setActivationPrice(float activationPrice) {
		this.activationPrice = activationPrice;
	}

	public float getPricePerMonth() {
		return this.pricePerMonth;
	}

	public void setPricePerMonth(float pricePerMonth) {
		this.pricePerMonth = pricePerMonth;
	}

	public String getServiceIncluded() {
		return this.serviceIncluded;
	}

	public void setServiceIncluded(String serviceIncluded) {
		this.serviceIncluded = serviceIncluded;
	}

	public void setSubServices(Set<ServiceEntity> subServices) {
		this.subServices = subServices;
	}

	public Set<ServiceEntity> getSubServices() {
		return subServices;
	}

	public void setCation(String cation) {
		this.cation = cation;
	}

	public String getCation() {
		return cation;
	}

	public void setWikiDescription(String wikiDescription) {
		this.wikiDescription = wikiDescription;
	}

	public String getWikiDescription() {
		return wikiDescription;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public void setVisible(String visible) {
		this.visible = visible;
	}

	public String getVisible() {
		return visible;
	}

	public void setOptional(String optional) {
		this.optional = optional;
	}

	public String getOptional() {
		return optional;
	}

	public void setParentService(ServiceEntity parentService) {
		this.parentService = parentService;
	}

	public ServiceEntity getParentService() {
		return parentService;
	}

	public void setTestService(String testService) {
		this.testService = testService;
	}

	public String getTestService() {
		return testService;
	}
}